package com.allwees.bs.core.model.coupon.entity;


import com.allwees.bs.core.model.coupon.constant.EPromoUseType;
import com.allwees.bs.core.model.coupon.constant.ETimeUnit;
import com.allwees.bs.core.modelbase.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@MappedSuperclass
public abstract class PromoActiveDefModel extends BaseEntity {

    /** 值  **/
    @Column(length = 255)
    private String name;

    /** 值  **/
    private BigDecimal value;

    /** value text **/
    private String valueText;

    @Enumerated(EnumType.STRING)
    private EPromoUseType useType;

    /** 单人领取最大次数 **/
    protected Integer singleUserReceiveMaxCount;

    /** 领取最大次数单位 **/
    @Enumerated(EnumType.STRING)
    protected ETimeUnit receiveMaxCountUnit;

    /** 最大抵扣金额 **/
    private BigDecimal maxDeductAmt;
}
